package ESP.Util;

import java.util.Random;

public class RandomPassword {

	public static String getPassword(int length) {
		int i;
		int count = 0;
		char[] str = {'0','1','2','3','4','5','6','7','8','9'};
		
		StringBuffer sb = new StringBuffer();
		Random r = new Random();
		
		while(count < length) {
			i = Math.abs(r.nextInt(10));
			
			if(i >= 0 && i < str.length) {
				sb.append(str[i]);
				count++;
			}
		}
		
		return sb.toString();
	}
}
